#include <bits/stdc++.h>
#ifndef DEBUG
#define debug
#endif
using namespace std;
using i64 = int64_t;

int dp[71][71][71];
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, cost;
  cin >> n >> cost;
  struct Node {int v, w, p;};
  vector<Node> node(n + 1);
  vector<int> w(n);
  for (int i = 1; i <= n; i ++) cin >> node[i].v;
  for (int i = 1; i <= n; i ++) cin >> node[i].w, w[i - 1] = node[i].w;
  for (int i = 1; i <= n; i ++) cin >> node[i].p;
  sort(node.begin() + 1, node.end(), [&](const Node &a, const Node &b) {
    return a.v < b.v;
  });

  sort(w.begin(), w.end());
  w.erase(unique(w.begin(), w.end()), w.end());
  for (int i = 1; i <= n; i ++) node[i].w = lower_bound(w.begin(), w.end(), node[i].w) - w.begin();

  vector<int> sump(n + 1);
  for (int i = 1; i <= n; i ++) sump[i] = sump[i - 1] + node[i].p;
  auto sum = [&](int l, int r) { return sump[r] - sump[l - 1]; };

  for (int limit = (int)w.size() - 1; limit >= 0; limit --) {
    for (int l = n; l >= 1; l --) {
      dp[limit][l][l] = node[l].p + (node[l].w < limit ? cost : 0);
      for (int r = l + 1; r <= n; r ++) {
        dp[limit][l][r] = INT_MAX;
        auto &res = dp[limit][l][r];
        for (int k = l; k <= r; k ++) {
          if (node[k].w >= limit) {
            res = min(res, dp[node[k].w][l][k - 1] + dp[node[k].w][k + 1][r] + sum(l, r));
          }
          res = min(res, dp[limit][l][k - 1] + dp[limit][k + 1][r] + cost + sum(l, r));
        }
      }
    }
  }
  cout << dp[0][1][n] << endl;
}